<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>支付通道配置</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi"/>
    <link rel="shortcut icon" href="/static/favicon.ico" type="image/x-icon"/>
    <link rel="stylesheet" href="/static/css/font.css">
    <link rel="stylesheet" href="/static/css/xadmin.css">
    <script type="text/javascript" charset="utf-8" src="/static/js/jquery-1.11.3.min.js"></script>
    <script src="/static/lib/layui/layui.js" charset="utf-8"></script>
    <script type="text/javascript" src="/static/js/xadmin.js"></script>
</head>
<body>
<div class="x-nav">
      <span class="layui-breadcrumb">
        <a href="/admin/welcomepage">首页</a>
       <a href="javascript:window.location.reload();">
          <cite>支付通道配置</cite>
        </a>
      </span>
    <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right"
       href="javascript:void(0);" onclick="reload_iframe();" title="刷新">
        <i class="layui-icon" style="line-height:30px">ဂ</i>
    </a>
</div>
<div class="x-body">
    <blockquote class="layui-elem-quote">
        提示:请在此处配置邮件发送,各平台支付信息,证书配置,请仔细填写!
    </blockquote>
    <fieldset class="layui-elem-field layui-col-md11 " style="margin-top: 10px;">
        <legend>异步通知设置</legend>
        <div style="height: 20px;"></div>
        <form class="layui-form layui-col-md-offset1" onsubmit="return false;" id="fthyhjj">
            <input type="hidden" name="id" value="${model.id!}">
            <div class="layui-form-item">
                <div class="layui-inline layui-col-md5">
                    <label class="layui-form-label">支付回调地址:</label>
                    <div class="layui-input-inline">
                        <input type="text" name="retDomain" autocomplete="" value="${model.retDomain!}"
                               class="layui-input">
                    </div>
                </div>
                <div class="layui-inline layui-col-md5">
                    <label class="layui-form-label">新浪短链接生成KEY:</label>
                    <div class="layui-input-inline">
                        <input type="text" name="sinaUrlKey" value="${model.sinaUrlKey!}" autocomplete="off"
                               class="layui-input">
                    </div>
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-input-block">
                    <button class="layui-btn layui-col-md-offset4" onclick="update_info('fthyhjj')">保存修改</button>
                </div>
            </div>
        </form>
    </fieldset>
    <fieldset class="layui-elem-field layui-col-md11 " style="margin-top: 10px;">
        <legend>支付通道轮询设置</legend>
        <div style="height: 20px;"></div>
        <form class="layui-form layui-col-md-offset1" onsubmit="return false;" id="fthyhjj12">
            <input type="hidden" name="id" value="${model.id!}">
            <div class="layui-form-item ">
                <div class="layui-inline layui-col-md5">
                    <label class="layui-form-label">轮询状态:</label>
                    <div class="layui-input-inline">
                        <select name="lxStatus" lay-filter="level" id="select_111">
                            <option value="0"
                            <%if(model.lxStatus! == 0){%>selected<%}%> >关闭</option>
                            <option value="1"
                            <%if(model.lxStatus! == 1){%>selected<%}%> >开启</option>
                        </select>
                    </div>
                </div>
                <div class="layui-inline layui-col-md5" id="w1111111">
                    <label class="layui-form-label">轮询模式:</label>
                    <div class="layui-input-inline">
                        <select name="lxMode">
                            <option value="0"
                            <%if(model.lxMode! == 0){%>selected<%}%> >全部通道随机轮询</option>
                            <option value="1"
                            <%if(model.lxMode! == 1){%>selected<%}%> >按通道设定金额范围随机</option>
                        </select>
                    </div>
                </div>
            </div>
            <div class="layui-form-item" id="xxxxx1">
                <label class="layui-form-label">
                    <span class="x-red">*</span>易支付通道:
                </label>
                <div class="layui-input-inline">
                    <select name="defaultEpayAlipay">
                        <option value="0">请选择</option>
                        <%for(o in epayConfigs!){%>
                        <option value="${o.id!}" <%if(model.defaultEpayAlipay! == o.id!){%>selected<%}%> >${o.epayName!}</option>
                        <%}%>
                    </select>
                </div>
                <div class="layui-form-mid layui-word-aux">
                    <span class="x-red">说明:</span>轮询模式关闭后需要指定默认的易支付(支付宝)通道!
                </div>
            </div>
            <div class="layui-form-item" id="xxxxx2">
                <label  class="layui-form-label">
                    <span class="x-red">*</span>易支付通道:
                </label>
                <div class="layui-input-inline">
                    <select name="defaultEpayQqpay">
                        <option value="0">请选择</option>
                        <%for(o in epayConfigs!){%>
                        <option value="${o.id!}" <%if(model.defaultEpayQqpay! == o.id!){%>selected<%}%> >${o.epayName!}</option>
                        <%}%>
                    </select>
                </div>
                <div class="layui-form-mid layui-word-aux">
                    <span class="x-red">说明:</span>轮询模式关闭后需要指定默认的易支付(QQ钱包)通道!
                </div>
            </div>
            <div class="layui-form-item" id="xxxxx3">
                <label  class="layui-form-label">
                    <span class="x-red">*</span>易支付通道:
                </label>
                <div class="layui-input-inline">
                    <select name="defaultEpayWxpay">
                        <option value="0">请选择</option>
                        <%for(o in epayConfigs!){%>
                        <option value="${o.id!}" <%if(model.defaultEpayWxpay! == o.id!){%>selected<%}%> >${o.epayName!}</option>
                        <%}%>
                    </select>
                </div>
                <div class="layui-form-mid layui-word-aux">
                    <span class="x-red">说明:</span>轮询模式关闭后需要指定默认的易支付(微信支付)通道!
                </div>
            </div>
            <div class="layui-form-item" id="xxxxx4">
                <label  class="layui-form-label">
                    <span class="x-red">*</span>码支付通道:
                </label>
                <div class="layui-input-inline">
                    <select name="defaultCodepayWxpay">
                        <option value="0">请选择</option>
                        <%for(o in codepayConfigs!){%>
                        <option value="${o.id!}" <%if(model.defaultCodepayWxpay! == o.id!){%>selected<%}%> >${o.epayName!}</option>
                        <%}%>
                    </select>
                </div>
                <div class="layui-form-mid layui-word-aux">
                    <span class="x-red">说明:</span>轮询模式关闭后需要指定默认的码支付(微信支付)通道!
                </div>
            </div>
            <div class="layui-form-item" id="xxxxx5">
                <label  class="layui-form-label">
                    <span class="x-red">*</span>码支付通道:
                </label>
                <div class="layui-input-inline">
                    <select name="defaultCodepayQq">
                        <option value="0">请选择</option>
                        <%for(o in codepayConfigs!){%>
                        <option value="${o.id!}" <%if(model.defaultCodepayQq! == o.id!){%>selected<%}%> >${o.epayName!}</option>
                        <%}%>
                    </select>
                </div>
                <div class="layui-form-mid layui-word-aux">
                    <span class="x-red">说明:</span>轮询模式关闭后需要指定默认的码支付(QQ钱包)通道!
                </div>
            </div>
            <div class="layui-form-item" id="xxxxx6">
                <label  class="layui-form-label">
                    <span class="x-red">*</span>码支付通道:
                </label>
                <div class="layui-input-inline">
                    <select name="defaultCodepayAlipay">
                        <option value="0">请选择</option>
                        <%for(o in codepayConfigs!){%>
                        <option value="${o.id!}" <%if(model.defaultCodepayAlipay! == o.id!){%>selected<%}%> >${o.epayName!}</option>
                        <%}%>
                    </select>
                </div>
                <div class="layui-form-mid layui-word-aux">
                    <span class="x-red">说明:</span>轮询模式关闭后需要指定默认的码支付(支付宝)通道!
                </div>
            </div>
            <div class="layui-form-item" id="xxxxx7">
                <label  class="layui-form-label">
                    <span class="x-red">*</span>支付宝通道:
                </label>
                <div class="layui-input-inline">
                    <select name="defaultAlipay">
                        <option value="0">请选择</option>
                        <%for(o in alipayConfigs!){%>
                        <option value="${o.id!}" <%if(model.defaultAlipay! == o.id!){%>selected<%}%> >${o.epayName!}</option>
                        <%}%>
                    </select>
                </div>
                <div class="layui-form-mid layui-word-aux">
                    <span class="x-red">说明:</span>轮询模式关闭后需要指定默认的支付宝通道!
                </div>
            </div>
            <div class="layui-form-item" id="xxxxx8">
                <label  class="layui-form-label">
                    <span class="x-red">*</span>QQ钱包通道:
                </label>
                <div class="layui-input-inline">
                    <select name="delaultQqpay">
                        <option value="0">请选择</option>
                        <%for(o in qqpayConfigs!){%>
                        <option value="${o.id!}" <%if(model.delaultQqpay! == o.id!){%>selected<%}%> >${o.epayName!}</option>
                        <%}%>
                    </select>
                </div>
                <div class="layui-form-mid layui-word-aux">
                    <span class="x-red">说明:</span>轮询模式关闭后需要指定默认的QQ钱包通道!
                </div>
            </div>
            <div class="layui-form-item" id="xxxxx9">
                <label  class="layui-form-label">
                    <span class="x-red">*</span>微信通道:
                </label>
                <div class="layui-input-inline">
                    <select name="defaultWxpay">
                        <option value="0">请选择</option>
                        <%for(o in wxpayConfigs!){%>
                        <option value="${o.id!}" <%if(model.defaultWxpay! == o.id!){%>selected<%}%> >${o.epayName!}</option>
                        <%}%>
                    </select>
                </div>
                <div class="layui-form-mid layui-word-aux">
                    <span class="x-red">说明:</span>轮询模式关闭后需要指定默认的微信支付通道!
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-input-block">
                    <button class="layui-btn layui-col-md-offset4" onclick="update_info('fthyhjj12')">保存修改</button>
                </div>
            </div>
        </form>
    </fieldset>
    <fieldset class="layui-elem-field layui-col-md11 " style="margin-top: 10px;">
        <legend>打款账户设置</legend>
        <div style="height: 20px;"></div>
        <form class="layui-form layui-col-md-offset1" onsubmit="return false;" id="fthyhjjdedsd">
            <input type="hidden" name="id" value="${model.id!}">
            <div class="layui-form-item ">
                <div class="layui-inline layui-col-md5">
                    <label class="layui-form-label">微信打款零钱:</label>
                    <div class="layui-input-inline">
                        <select name="trWxpay">
                            <option value="0">请选择</option>
                            <%for(o in wxpayConfigs!){%>
                            <option value="${o.id!}" <%if(model.trWxpay! == o.id!){%>selected<%}%> >${o.epayName!}</option>
                            <%}%>
                        </select>
                    </div>
                </div>
                <div class="layui-inline layui-col-md5">
                    <label class="layui-form-label">支付宝打款余额:</label>
                    <div class="layui-input-inline">
                        <select name="trAlipay">
                            <option value="0">请选择</option>
                            <%for(o in alipayConfigs!){%>
                            <option value="${o.id!}" <%if(model.trAlipay! == o.id!){%>selected<%}%> >${o.epayName!}</option>
                            <%}%>
                        </select>
                    </div>
                </div>
            </div>
            <div class="layui-form-item ">
                <div class="layui-inline layui-col-md5">
                    <label class="layui-form-label">微信转账银行卡:</label>
                    <div class="layui-input-inline">
                        <select name="trWxpayCard">
                            <option value="0">请选择</option>
                            <%for(o in wxpayConfigs!){%>
                            <option value="${o.id!}" <%if(model.trWxpayCard! == o.id!){%>selected<%}%> >${o.epayName!}</option>
                            <%}%>
                        </select>
                    </div>
                </div>
                <div class="layui-inline layui-col-md5">
                    <label class="layui-form-label"></label>
                    <div class="layui-input-inline">
                        <button class="layui-btn layui-col-md-offset4" onclick="update_info('fthyhjjdedsd')">保存信息</button>
                    </div>
                </div>
            </div>
        </form>
    </fieldset>
    <fieldset class="layui-elem-field layui-col-md11 " style="margin-top: 10px;">
        <legend>支付立减优惠设置</legend>
        <div style="height: 20px;"></div>
        <form class="layui-form layui-col-md-offset1" onsubmit="return false;" id="fthyhjj3232232323">
            <input type="hidden" name="id" value="${model.id!}">
            <div class="layui-form-item ">
                <div class="layui-inline layui-col-md5">
                    <label class="layui-form-label">状态:</label>
                    <div class="layui-input-inline">
                       <select name="paySale">
                           <option value="0" <%if(model.paySale! == 0){%>selected<%}%> >关闭</option>
                           <option value="1" <%if(model.paySale! == 1){%>selected<%}%> >开启</option>
                       </select>
                    </div>
                </div>
                <div class="layui-inline layui-col-md5">
                    <label class="layui-form-label">减免最小金额:</label>
                    <div class="layui-input-inline">
                        <input type="text" name="paySaleMin" value="${model.paySaleMin!}" autocomplete="off"
                               class="layui-input ">
                    </div>
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-inline layui-col-md5">
                    <label class="layui-form-label">减免最大金额:</label>
                    <div class="layui-input-inline">
                        <input type="text" name="paySaleMax" value="${model.paySaleMax!}" autocomplete="off"
                               class="layui-input">
                    </div>
                </div>
                <div class="layui-inline layui-col-md5">
                    <label class="layui-form-label">优惠开始金额:</label>
                    <div class="layui-input-inline">
                        <input type="text" name="paySaleStart" value="${model.paySaleStart!}" autocomplete="off"
                               class="layui-input">
                    </div>
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-inline layui-col-md5">
                    <label class="layui-form-label">优惠结束金额:</label>
                    <div class="layui-input-inline">
                        <input type="text" name="paySaleStop" autocomplete="" value="${model.paySaleStop!}"
                               class="layui-input">
                    </div>
                </div>
                <div class="layui-inline layui-col-md5">
                    <label class="layui-form-label"></label>
                    <div class="layui-input-inline">
                        <button class="layui-btn layui-col-md-offset4" onclick="update_info('fthyhjj3232232323')">保存信息</button>
                    </div>
                </div>
            </div>
        </form>
    </fieldset>
    <div style="height: 20px;"></div>
</div>
</body>
<!--<script src="/file/ajaxupload.file"></script>-->
<script>
    $(function () {
        layui.use(['form', 'layer'], function () {
            $ = layui.jquery;
            var form = layui.form;
            form.on('select(level)', function(data){
                change_option_select(data);
            });

        });
        setTimeout(function () {
            $('#select_111').next().find('.layui-anim').children('dd[lay-value="${model.lxStatus!0}"]').click();
        },200);
    });

    function change_option_select(obj) {
        var type = obj.value;
        if (type == 1){
            $("#w1111111").show();
            $("#xxxxx1").hide();
            $("#xxxxx2").hide();
            $("#xxxxx3").hide();
            $("#xxxxx4").hide();
            $("#xxxxx5").hide();
            $("#xxxxx6").hide();
            $("#xxxxx7").hide();
            $("#xxxxx8").hide();
            $("#xxxxx9").hide();
            $("#xxxxx10").hide();
            $("#xxxxx11").hide();
            $("#xxxxx12").hide();
        } else {
            $("#w1111111").hide();
            $("#xxxxx1").show();
            $("#xxxxx2").show();
            $("#xxxxx3").show();
            $("#xxxxx4").show();
            $("#xxxxx5").show();
            $("#xxxxx6").show();
            $("#xxxxx7").show();
            $("#xxxxx8").show();
            $("#xxxxx9").show();
            $("#xxxxx10").show();
            $("#xxxxx11").show();
            $("#xxxxx12").show();
        }
    }

    function update_info(obj) {
        var data = $("#" + obj).serialize();
        layer.load(0);
        $.post("/admin/payconfig/update",
            data,
            function (data) {
            layer.closeAll();
                layer.alert(data.msg, {icon: 6}, function () {
                    window.location.reload();
                    var index = parent.layer.getFrameIndex(window.name);
                    parent.layer.close(index);
                });
            }, "json");
    }

    window.onload  = close_loading_msg();

    function reload_iframe() {
        parent.obj = parent.layer.load(0);
        location.replace(location.href);
    }

</script>
</html>